package com.project.springboot.lock;

/**
 * description: 计数器
 * @author 朱正磊
 * @date 2025-06-05 11:03:36
 */
public class CounterT {

    private Integer count = 0;

    public synchronized void add() {
        count++;
        System.out.println("线程 = " + Thread.currentThread().getName() + ", count = " + count);
    }

    public Integer getCount() {
        return count;
    }

}
